package com.example.trb.entity.view;

import com.baomidou.mybatisplus.annotation.TableName;
import com.example.trb.validation.DateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;
import java.util.Date;

@Data
@TableName("user_all_info")
public class UserAllInfo {
    private Integer id;
    @Null
    private Integer userId;
    @Null
    private String account;

    @NotBlank(message = "名字不能为空")
    private String name;

    @NotBlank(message = "性别不能为空")
    @Pattern(regexp = "男|女", message = "性别必须是男或女")
    private String sex;

    @NotBlank
    private String nation;

    @NotBlank
    @Length(min = 18, max = 18, message = "不合法的身份证号码")
    private String idCardNumber;

    @NotNull
    @DateTime(format = "yyyy-MM-dd", message = "参加时间的格式为yyyy-MM-dd")
    private String birthday;

    @NotBlank
    private String department;

    @NotBlank
    @Pattern(regexp = "群众|共产党员|共青团员")
    private String politicalAppearance;

    @NotBlank
    private String personalStatus;

    @NotBlank(message = "手机号不能为空")
    @Length(min = 11, max = 11 , message = "手机号只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$",message = "手机号码格式不正确")
    private String phoneNumber;

    @NotBlank
    @Email(message = "邮箱格式错误")
    private String email;

    @NotBlank
    @URL(message = "url格式不符合")
    private String idCardFrontPhoto;

    @NotBlank
    @URL(message = "url格式不符合")
    private String idCardReversePhoto;

    @NotBlank
    private String origin;

    @NotBlank
    private String address;

    @NotBlank
    @URL(message = "url格式不符合")
    private String twoInchPhoto;

    @NotBlank
    private String executive;
}
